using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._CartographyTools._Generalization
{
    /// <summary>
    /// <para>Aggregate Polygons</para>
    /// <para>Combines polygons that are within a specified distance of each other into new polygons.</para>
    /// <para>将彼此相距一定距离的多边形合并为新多边形。</para>
    /// </summary>    
    [DisplayName("Aggregate Polygons")]
    public class AggregatePolygons : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AggregatePolygons()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The polygon features to be aggregated. If this is a layer referencing a representation and shape overrides are present on the input features, the overridden shapes, not the feature shapes, will be considered in aggregation processing.</para>
        /// <para>要聚合的面要素。如果这是一个引用制图表达的图层，并且输入要素上存在形状覆盖，则在聚合处理中将考虑覆盖的形状，而不是要素形状。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The output feature class to be created.</para>
        /// <para>要创建的输出要素类。</para>
        /// </param>
        /// <param name="_aggregation_distance">
        /// <para>Aggregation Distance</para>
        /// <para>The distance to be satisfied between polygon boundaries for aggregation to occur. A distance must be specified, and it must be greater than zero. You can choose a preferred unit; the default is the feature unit.</para>
        /// <para>要进行聚合的多边形边界之间要满足的距离。必须指定距离，并且该距离必须大于零。您可以选择首选单位;默认值为要素单位。</para>
        /// </param>
        public AggregatePolygons(object _in_features, object _out_feature_class, string? _aggregation_distance)
        {
            this._in_features = _in_features;
            this._out_feature_class = _out_feature_class;
            this._aggregation_distance = _aggregation_distance;
        }
        public override string ToolboxName => "Cartography Tools";

        public override string ToolName => "Aggregate Polygons";

        public override string CallName => "cartography.AggregatePolygons";

        public override List<string> AcceptEnvironments => ["MDomain", "XYDomain", "XYTolerance", "cartographicPartitions", "extent", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_features, _out_feature_class, _aggregation_distance, _minimum_area, _minimum_hole_size, _orthogonality_option.GetGPValue(), _barrier_features, _out_table, _aggregate_field];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The polygon features to be aggregated. If this is a layer referencing a representation and shape overrides are present on the input features, the overridden shapes, not the feature shapes, will be considered in aggregation processing.</para>
        /// <para>要聚合的面要素。如果这是一个引用制图表达的图层，并且输入要素上存在形状覆盖，则在聚合处理中将考虑覆盖的形状，而不是要素形状。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The output feature class to be created.</para>
        /// <para>要创建的输出要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Aggregation Distance</para>
        /// <para>The distance to be satisfied between polygon boundaries for aggregation to occur. A distance must be specified, and it must be greater than zero. You can choose a preferred unit; the default is the feature unit.</para>
        /// <para>要进行聚合的多边形边界之间要满足的距离。必须指定距离，并且该距离必须大于零。您可以选择首选单位;默认值为要素单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Aggregation Distance")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public string? _aggregation_distance { get; set; }


        /// <summary>
        /// <para>Minimum Area</para>
        /// <para>The minimum area for an aggregated polygon to be retained. The default value is zero, that is, to keep all polygons. You can specify a preferred unit; the default is the feature unit.</para>
        /// <para>要保留聚合面的最小面积。默认值为零，即保留所有多边形。您可以指定首选单位;默认值为要素单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Area")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _minimum_area { get; set; } = null;


        /// <summary>
        /// <para>Minimum Hole Size</para>
        /// <para>The minimum size of a polygon hole to be retained. The default value is zero, that is, to keep all polygon holes. You can specify a preferred unit; the default is the feature unit.</para>
        /// <para>要保留的面孔的最小尺寸。默认值为零，即保留所有多边形孔。您可以指定首选单位;默认值为要素单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Hole Size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _minimum_hole_size { get; set; } = null;


        /// <summary>
        /// <para>Preserve orthogonal shape</para>
        /// <para><xdoc>
        ///   <para>Specifies the characteristic of the output features when constructing the aggregated boundaries.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked--Organically shaped output features will be created. This is suitable for natural features, such as vegetation or soil polygons. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked--Orthogonally shaped output features will be created. This is suitable for preserving the geometric characteristic of anthropogenic input features, such as building footprints.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定构造聚合边界时输出要素的特征。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 （Unchecked） - 将创建有机形状的输出要素。这适用于自然要素，例如植被或土壤多边形。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 （Checked） - 将创建正交形状的输出要素。这适用于保留人为输入要素（例如建筑物覆盖区）的几何特征。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Preserve orthogonal shape")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _orthogonality_option_value _orthogonality_option { get; set; } = _orthogonality_option_value._false;

        public enum _orthogonality_option_value
        {
            /// <summary>
            /// <para>ORTHOGONAL</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ORTHOGONAL")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NON_ORTHOGONAL</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NON_ORTHOGONAL")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Barrier Features</para>
        /// <para>The layers containing the line or polygon features that are aggregation barriers for input features. Features will not be aggregated across barrier features. Barrier features that are in geometric conflict with input features will be ignored.</para>
        /// <para>包含作为输入要素聚合障碍的线或面要素的图层。要素不会跨障碍要素聚合。与输入要素存在几何冲突的障碍要素将被忽略。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Barrier Features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _barrier_features { get; set; } = null;


        /// <summary>
        /// <para>Output Table</para>
        /// <para>A one-to-many relationship table that links the aggregated polygons to their source polygon features. This table contains two fields, OUTPUT_FID and INPUT_FID, that store the aggregated feature IDs and their source feature IDs, respectively. Use this table to derive necessary attributes for the output features from their source features. The default name for this table is the name of the output feature class, appended with _tbl. The default path is the same as the output feature class. No table is created when this parameter is left blank.</para>
        /// <para>将聚合面链接到其源面要素的一对多关系表。此表包含两个字段（OUTPUT_FID 和 INPUT_FID），分别存储聚合要素 ID 及其源要素 ID。使用此表可从输出要素的源要素中派生出输出要素的必要属性。此表的默认名称为输出要素类的名称，并附加了 _tbl。默认路径与输出要素类相同。如果此参数留空，则不会创建任何表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Table")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_table { get; set; } = null;


        /// <summary>
        /// <para>Aggregate Field</para>
        /// <para>The field that contains attributes for aggregation. Features must share the same attribute value to be considered for aggregation. For example, use a building classification field as the aggregate field to prevent commercial buildings from aggregating with residential buildings.</para>
        /// <para>包含聚合属性的字段。要素必须共享相同的属性值才能考虑聚合。例如，使用建筑物分类字段作为聚合字段，以防止商业建筑物与住宅建筑物聚合。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Aggregate Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _aggregate_field { get; set; } = null;


        public AggregatePolygons SetEnv(object MDomain = null, object XYDomain = null, object XYTolerance = null, object cartographicPartitions = null, object extent = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(MDomain: MDomain, XYDomain: XYDomain, XYTolerance: XYTolerance, cartographicPartitions: cartographicPartitions, extent: extent, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}